package com.sg.controller.bff;

import com.sg.service.biz.bff.StaffingService;
import com.sg.dto.biz.bff.req.*;
import com.sg.dto.biz.bff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "Staffing", tags = {"Staffing"})
@RestController
// @RequestMapping("/oms/staffing/")
public class StaffingController {

    @Autowired
    StaffingService staffingService;

    /**
     * B1-3批量新增编制（管理）
     * gen by moon at 8/10/2022, 3:36:28 AM
     */
    @PostMapping("/oms/mgt/staffing/batchAddStaffing")
    @ApiOperation(value = "B1-3批量新增编制（管理）", response = OkrResult.class)
    public OkrResult<BffBatchAddStaffingRespDto> batchAddStaffing(@RequestBody(required = false) @Validated BffBatchAddStaffingReqDto reqDTO) {
        return OkrResult.success(staffingService.batchAddStaffing(reqDTO));
    }

    /**
     * B1-3发布编制（管理）
     * gen by moon at 8/10/2022, 3:36:32 AM
     */
    @PostMapping("/oms/mgt/staffing/releaseStaffing")
    @ApiOperation(value = "B1-3发布编制（管理）", response = OkrResult.class)
    public OkrResult<BffReleaseStaffingRespDto> releaseStaffing(@RequestBody(required = false) @Validated BffReleaseStaffingReqDto reqDTO) {
        return OkrResult.success(staffingService.releaseStaffing(reqDTO));
    }

    /**
     * B1-3存档编制(管理）
     * gen by moon at 8/10/2022, 3:36:30 AM
     */
    @PostMapping("/oms/mgt/staffing/archiveStaffing")
    @ApiOperation(value = "B1-3存档编制(管理）", response = OkrResult.class)
    public OkrResult<BffArchiveStaffingRespDto> archiveStaffing(@RequestBody(required = false) @Validated BffArchiveStaffingReqDto reqDTO) {
        return OkrResult.success(staffingService.archiveStaffing(reqDTO));
    }

    /**
     * B1-3新增编制（管理）
     * gen by moon at 8/10/2022, 3:36:27 AM
     */
    @PostMapping("/oms/mgt/staffing/addPositionStaffing")
    @ApiOperation(value = "B1-3新增编制（管理）", response = OkrResult.class)
    public OkrResult<BffAddPositionStaffingRespDto> addPositionStaffing(@RequestBody(required = false) @Validated BffAddPositionStaffingReqDto reqDTO) {
        return OkrResult.success(staffingService.addPositionStaffing(reqDTO));
    }

    /**
     * B1-3批量补充部门编制（管理）
     * gen by moon at 8/10/2022, 3:37:35 AM
     */
    @PostMapping("/oms/mgt/staffing/batchUpdateDeptStaffing")
    @ApiOperation(value = "B1-3批量补充部门编制（管理）", response = OkrResult.class)
    public OkrResult<BffBatchUpdateDeptStaffingRespDto> batchUpdateDeptStaffing(@RequestBody(required = false) @Validated BffBatchUpdateDeptStaffingReqDto reqDTO) {
        return OkrResult.success(staffingService.batchUpdateDeptStaffing(reqDTO));
    }

    /**
     * B1-3补充部门编制（管理）
     * gen by moon at 8/10/2022, 3:37:34 AM
     */
    @PostMapping("/oms/mgt/staffing/updateDeptStaffing")
    @ApiOperation(value = "B1-3补充部门编制（管理）", response = OkrResult.class)
    public OkrResult<BffUpdateDeptStaffingRespDto> updateDeptStaffing(@RequestBody(required = false) @Validated BffUpdateDeptStaffingReqDto reqDTO) {
        return OkrResult.success(staffingService.updateDeptStaffing(reqDTO));
    }

    /**
     * B1-3批量补充组织编制（管理）
     * gen by moon at 8/10/2022, 3:37:32 AM
     */
    @PostMapping("/oms/mgt/staffing/batchUpdateOrgStaffing")
    @ApiOperation(value = "B1-3批量补充组织编制（管理）", response = OkrResult.class)
    public OkrResult<BffBatchUpdateOrgStaffingRespDto> batchUpdateOrgStaffing(@RequestBody(required = false) @Validated BffBatchUpdateOrgStaffingReqDto reqDTO) {
        return OkrResult.success(staffingService.batchUpdateOrgStaffing(reqDTO));
    }

    /**
     * B1-3补充组织编制（管理）
     * gen by moon at 8/10/2022, 3:37:31 AM
     */
    @PostMapping("/oms/mgt/staffing/updateOrgStaffing")
    @ApiOperation(value = "B1-3补充组织编制（管理）", response = OkrResult.class)
    public OkrResult<BffUpdateOrgStaffingRespDto> updateOrgStaffing(@RequestBody(required = false) @Validated BffUpdateOrgStaffingReqDto reqDTO) {
        return OkrResult.success(staffingService.updateOrgStaffing(reqDTO));
    }

    /**
     * B1-3查询职务编制账户数量详情（管理）
     * gen by moon at 8/10/2022, 3:37:24 AM
     */
    @PostMapping("/oms/mgt/staffing/queryPositionStaffingAcntNumDetail")
    @ApiOperation(value = "B1-3查询职务编制账户数量详情（管理）", response = OkrResult.class)
    public OkrResult<BffQueryPositionStaffingAcntNumDetailRespDto> queryPositionStaffingAcntNumDetail(@RequestBody(required = false) @Validated BffQueryPositionStaffingAcntNumDetailReqDto reqDTO) {
        return OkrResult.success(staffingService.queryPositionStaffingAcntNumDetail(reqDTO));
    }

    /**
     * B1-3查询组织编制列表（管理）
     * gen by moon at 8/10/2022, 3:37:20 AM
     */
    @PostMapping("/oms/mgt/staffing/queryOrgStaffingList")
    @ApiOperation(value = "B1-3查询组织编制列表（管理）", response = OkrResult.class)
    public OkrResult<BffQueryOrgStaffingListRespDto> queryOrgStaffingList(@RequestBody(required = false) @Validated BffQueryOrgStaffingListReqDto reqDTO) {
        return OkrResult.success(staffingService.queryOrgStaffingList(reqDTO));
    }

    /**
     * B1-3查询职务编制列表（管理）
     * gen by moon at 8/10/2022, 3:36:30 AM
     */
    @PostMapping("/oms/mgt/staffing/queryPositionStaffingList")
    @ApiOperation(value = "B1-3查询职务编制列表（管理）", response = OkrResult.class)
    public OkrResult<BffQueryPositionStaffingListRespDto> queryPositionStaffingList(@RequestBody(required = false) @Validated BffQueryPositionStaffingListReqDto reqDTO) {
        return OkrResult.success(staffingService.queryPositionStaffingList(reqDTO));
    }

    /**
     * B1-3查询部门编制列表（管理）
     * gen by moon at 8/10/2022, 3:33:52 AM
     */
    @PostMapping("/oms/mgt/staffing/queryDeptStaffingList")
    @ApiOperation(value = "B1-3查询部门编制列表（管理）", response = OkrResult.class)
    public OkrResult<BffQueryDeptStaffingListRespDto> queryDeptStaffingList(@RequestBody(required = false) @Validated BffQueryDeptStaffingListReqDto reqDTO) {
        return OkrResult.success(staffingService.queryDeptStaffingList(reqDTO));
    }
}
